package com.shop.trade.conf;

import com.shop.common.tmpl.BaseController;
import com.shop.common.util.excption.UserNotFoundException;
import com.shop.common.util.state.ResultCode;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class CommenExceptionHandler extends BaseController {

    @ExceptionHandler(UserNotFoundException.class)
    @ResponseBody
    public String userNotFoundExceptionHandler(Exception e) {

        return returnMsg(ResultCode.NOTLOGIN.value(), e.getMessage());
    }
}
